function GetRequest() {   
			   var url = location.search; //获取url中"?"符后的字串   
			   var theRequest = new Object();   
			   if (url.indexOf("?") != -1) {   
			      var str = url.substr(1);   
			      strs = str.split("&");   
			      for(var i = 0; i < strs.length; i ++) {   
			         theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);   
			      }   
  			 }   
   			return theRequest;   
		}   
		
		layui.use(['upload','element','table','form'],function(){
			 var $ = layui.jquery
  			,upload = layui.upload
			,table = layui.table
			,layer = layui.layer
			,element =layui.element
			,form = layui.form
			var paperId = GetRequest().paperId;
			
			$("#submitQuestions").click(function(){
				var title = $("#title").val(),
				 optionA = $("#optionA").val(),
				 optionB = $("#optionB").val(),
				 optionC = $("#optionC").val(),
				 optionD = $("#optionD").val()
				 
				$.ajax({
					url:"http://localhost:8888/question/add",
					data:{"title":title,"optionA":optionA,"optionB":optionB,"optionC":optionC,"optionD":optionD,"paperId":paperId},
					success:function(data){
						layer.msg("添加成功！")
					},
					error:function(){
						layer.msg("上传失败！")
					}
				})
			})
			
  });
